#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: ystlong
# @Date:   2018-07-01 00:19:47
# @Last Modified by:   ystlong
# @Last Modified time: 2018-07-01 00:29:00

import sys

def gen_key(keys):
	key_len = len(keys)
	for i in xrange(key_len-1):
		key1 = keys[i]
		key2 = keys[i+1]
		l1 = len(key1)
		l2 = len(key2)
		gen_key = []
		for j in xrange(min(l1, l2)):
			if key1[j] == key2[j]:
				gen_key.append(key1[j])
			else:
				gen_key.append(".")
		keys[i+1] = "".join(gen_key)
	print keys[-1]

def main():
	if(len(sys.argv) < 3):
		print "usage: %s key1 key2 ... keyn"%(sys.argv[0])
		sys.exit(1)
	keys = sys.argv[1:]
	gen_key(keys)


if __name__ == '__main__':
	main()

